{% extends 'origin.html' %}

{% block content %}
    <div class="container">
        <div style="margin-top:-5px;margin-bottom:10px">
            <a class="btn btn-primary" href="{% url 'firstplan:everyday_add' %}">添加</a>
            <a class="btn btn-primary" href="{% url 'firstplan:everyday_add2' %}">多项添加</a>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading">{{title}}</div>

            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th style="text-align:center;vertical-align:middle">序号</th>
                        <th style="text-align:center;vertical-align:middle">日期</th>
                        <th style="text-align:center;vertical-align:middle">周几</th>
                        <th style="text-align:center;vertical-align:middle">人员</th>
                        <th style="text-align:center;vertical-align:middle">事件</th>
                        <th style="text-align:center;vertical-align:middle">积分扣除</th>
                        <th style="text-align:center;vertical-align:middle">操作</th>
                    </tr>
                </thead>
                <tbody>
                    {% for item in queryset %}
                        <tr id="row">
                            <th style="text-align:center;vertical-align:middle">{{item.id}}</th>
                            <th style="text-align:center;vertical-align:middle">{{item.date|date:"Y-m-d"}}</th>
                            <th style="text-align:center;vertical-align:middle">{{item.get_week}}</th>
                            <th style="text-align:center;vertical-align:middle">{{item.person}}</th>
                            <th style="vertical-align:middle">{{item.event}}</th>
                            <th style="text-align:center;vertical-align:middle">{{item.event.display_deduct_point}}</th>
                            <th style="text-align:center;vertical-align:middle">
                                <a href="{% url 'firstplan:everyday_edit' item.id %}">修改</a>
                                <a href="{% url 'firstplan:everyday_delete' item.id %}">删除</a>
                            </th>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
    <ul  class="pagination" style="margin-left:500px">
        {{page_string}}
    </ul>
{% endblock %}